<template>
  <div class="att-container">
        <van-nav-bar  :border="false"  class="tab-nav-bar"  >
            <van-icon slot="left" name="arrow-left" @click="$router.back()" /><span slot="left">我的关注</span>
        </van-nav-bar>
       <van-tabs v-model="active">
  <van-tab title="家服公司"> <homecoList   v-for="cot in coList" :key="cot.coId"   :colist="cot" type="2" /></van-tab>
  <van-tab title="家服人员"><homeStaff  v-for="sft in staffList" :key="sft.sId" :stafflist="sft" /></van-tab>
</van-tabs>

  </div>
</template>

<script>
import homecoList from '@/components/homeco-list'
import homeStaff from '@/components/home-staff'
import { getstaffList } from '@/api/staff'
import { getcompanyList } from '@/api/company'
export default {
  data () {
    return {
      active: 0, // 标签页索引
      staffList: [],
      coList: []
    }
  },
  components: {
    homecoList,
    homeStaff
  },
  created () {
    this.getlist()
  },
  mounted () {

  },
  methods: {
    async getlist () {
      const { data } = await getstaffList()
      console.log(data)
      this.staffList = data
      const arr = await getcompanyList()
      this.coList = arr.data
    }
  }
}
</script>

<style scoped lang="less">
.att-container{
  /deep/ .van-tab{
     background-color: #3f51b5;
     color: #fff;
  }
     /deep/  .van-tabs__line {
           background-color: #fff;
         }
  .tab-nav-bar{
    background-color: #3f51b5;

 .van-icon{
         padding-right: 10px;
         color: #fff;
     }
     span{
         color: #fff
     }
  }

}

</style>
